home *** CD-ROM | disk | FTP | other *** search
/ Power Tools 1993 October - Disc 2 / Power Tools (Disc 2)(October 1993)(HP).iso / hotlines / ccsyhl / sisapint / sisapint.txt
Text File  |  1993-05-21  |  40KB  |  809 lines

  1. Application Integration Using HP Software
  2. Integration Sockets
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11. 1.0     Introduction
  12.  
  13. This document provides technical guidance as you create a solution of
  14. integrated applications using HP Software Integration Sockets (HP
  15. Sockets). It covers the steps to take during your design and
  16. development process, including several important decisions to make
  17. during the process, and many helpful hints to make your development of
  18. an HP Sockets-based solution as smooth as possible. It also covers the
  19. writing of a full functioned adapter for an application independent of
  20. a specific integrated solution. One example is used throughout this
  21. document to further illustrate each step in the design and development
  22. process.
  23.  
  24. Application Integration Using HP Software Integration Sockets is one
  25. piece of the HP Sockets documentation set. It should be used in
  26. conjunction with the product manuals listed in the HP Sockets
  27. documentation roadmap in the last chapter.
  28.  
  29.  
  30. 2.0     Application Integration
  31.  
  32. Integrating applications allows two or more independent applications to
  33. behave like ONE application, sharing information and control
  34. transparent to the user of the integrated applications. To achieve this
  35. level of integration, you must understand the features you want in the
  36. integrated solution and have detailed knowLedge of the applications
  37. data import/export mechanisms and their data formats. Many design
  38. decisions that have to be made during the application integration
  39. process will be based on this knowledge.
  40.  
  41. The following flow chart outlines the design and development process
  42. for creating an integrated solution using HP Sockets. As you can see,
  43. there are many places where you may have to iterate on the design,
  44. based on new knowledge. The more detailed application knowledge you
  45. have at the start of the process, the fewer iterations will be required
  46. to complete the design.
  47.  
  48. The remainder of this document walks you through the steps of the
  49. application integration process.
  50.  
  51.  
  52. *** Object: Untitled
  53.  
  54.  
  55. 3.0     Application Integration Steps
  56.  
  57. This chapter walks you through each of the application integration
  58. steps that you will use in your integration project as shown in the
  59. previous flow chart.
  60.  
  61. As we go through the steps, we will discuss the creation of an
  62. integrated solution to demonstrate the concepts and design decisions
  63. presented here. Our example solution uses a Material Resource Planning
  64. (MRP) application, a Scheduling application, and a Factory Control
  65. application. Before being integrated, the Scheduling application uses
  66. the data from a product plan that was manually entered to determine a
  67. production schedule which is sent to the Factory Control application.
  68. In the integrated solution, the Scheduling application will use up-to-
  69. date finished goods inventory and stock level data from the MRP
  70. application, in addition to the product plan also from the MRP
  71. application, to create a better production schedule that is sent
  72. directly to the Factory Control application which will get the
  73. appropriate recipes from the MRP application to put the schedule into
  74. production. This integrated solution requires less manual entry and
  75. uses and provides more up-to-date information.
  76.  
  77. 3.1     Story Board the Integrated Solution
  78.  
  79. The decision to create an integrated solution often springs from
  80. someone's insight into their business such as "My factory could run
  81. more efficiently if the scheduler knew when new customer orders arrived
  82. and could adjust the production schedule accordingly" or "I could
  83. better satisfy my customers if I could get them product availability
  84. data on time." The creation of a solution to realize the in sight
  85. usually involves integrating data between two or more existing
  86. applications and possibly even with applications being written
  87. specifically for the new solution.
  88.  
  89. The questions that should be answered at this step of the project have
  90. little to do with HP Sockets but rather focus on the problem at hand,
  91. what functions are required to create the solution to the problem, and
  92. how the resulting solution should behave:
  93.  
  94. What is the goal of the integrated solution? What applications will you
  95. use to create the integrated solution? What are the high level
  96. functions that you want the integrated solution to perform?
  97.  
  98. 3.1.1   Example
  99.  
  100. The goal of our example integrated solution is to allow the re-
  101. evaluation of the master production plan on a weekly basis, using up-
  102. to-date inventory levels and the latest product plans, to create and
  103. automate the distribution of the daily production schedule and
  104. production recipes, and to report back on raw material consumption.
  105.  
  106. The applications necessary to create the integrated solution are:
  107.  
  108.         Materials Resource Planning application (MRP) Scheduling
  109.         application (SCHD) Factory Control application (FC)
  110.  
  111. The high level functions of the integrated solution are:
  112.  
  113. On a weekly basis: Create a master production plan (26 week plan)
  114. Optimize the production plan Release the new production plan to the
  115. resource planner Do the materials resource planning
  116.  
  117. On a daily basis: Create a production schedule (5 day plan) Optimize
  118. the production schedule Release the production schedule to
  119. manufacturing Get production recipes to implement production schedule
  120.  
  121. On an ongoing basis: Update material consumption
  122.  
  123. 3.2     Define High Level Data Flows
  124.  
  125. Once the high level functions of the integrated solution have been
  126. defined as part of the story board, the applications to perform those
  127. functions and the external data they require can be defined. The
  128. questions that should be answered at this step provide the information
  129. for you to draw a high level data flow diagram of the integrated
  130. solution.
  131.  
  132. This diagram together with the story board from the previous step
  133. should be used to verify the correctness and completeness of the
  134. solution with your customers. For each of the high level functions that
  135. were enumerated in the story board, answer these questions:
  136.  
  137. Which application will perform the function?  What data is required for
  138. that application to perform the function?  Where is that data produced
  139. and consumed?
  140.  
  141. A nice way to represent this information is to create a data flow table
  142. and diagram that work in conjunction with one another. The table
  143. summarizes the data required to implement each high level function and
  144. the providing and consuming applications. The data flow diagram is a
  145. pictorial depiction of that same data.
  146.  
  147. 3.2.1   Example
  148.  
  149. In our example, each high level function has an entry in the data flow
  150. table in this format:
  151.  
  152. Function #: <function description> - <application performing the
  153. function> Data
  154.         Flow #: <type of data> - <data producer> -> <data consumer>...
  155.         <enumerate all data flows required to implement the function>
  156.  
  157. For our example, the data flow table and diagram that correspond to the
  158. list of functions defined in section 3.1.1 follows:
  159.  
  160. Function 1: Create a master production plan - SCHD Data Flow 1A.
  161. Product plan - external source -> SCHD Data Flow 1B. Finished Goods
  162. Inventory - MRP -> SCHD
  163. Function 2: Optimize the production plan - SCHD All necessary data is
  164. local to the SCHD application
  165. Function 3: Release the new production plan to resource planning - SCHD
  166. Data  Flow 3A. Production Plan  -  SCHD -> MRP
  167. Function 4: Do the materials resource planning - MRP All necessary data
  168. is local to the MRP application
  169. Function 5: Create a production schedule - SCHD Data Flow 5A.
  170.     Stock Levels - MRP  -> SCHD Data Flow 5B. Orders - MRP -> SCHD
  171. Function 6: Optimize the production schedule - SCHD All necessary data
  172. is local to the SCHD application
  173. Function 7: Release the production schedule to manufacturing - SCHD
  174. Data Flow
  175.      7A. Production schedule - SCHD -> MRP Data Flow
  176.      7B. Production schedule - SCHD -> FC
  177. Function 8: Get production recipes to implement production schedule -
  178. FC Data Flow 8A. Recipe- MRP -> FC
  179. Function 9: Update material consumption - FC Data Flow 9A. Material
  180.     consumption - FC -> MRP
  181.  
  182.  
  183.  
  184. *** Object: Untitled
  185.  
  186.  
  187.  
  188. 3.3     Define Data Control and Access
  189.  
  190. After determining the high level data flows, you are now ready to start
  191. creating the data flow specifications for the integrated solution. This
  192. step examines how the data required to perform each function is
  193. accessed and controlled. This examination breaks down into four
  194. different questions to be answered:
  195.  
  196. Will the data be "pulled" by the consuming application from its
  197. producing application or will it be "pushed" from the producing
  198. application to the consuming one? What determines when this data "push"
  199. or "pull" happens? Where will the data be stored at the producing and
  200. consuming application? What mechanism will be used to access the data
  201. at the producing application and store the data at the consuming
  202. application?
  203.  
  204. Deciding whether the data should be "pushed" or "pulled" is usually
  205. based on what triggers the movement of the data. For example, the start
  206. of a high level fun ction could be triggered by a user operation, a
  207. scheduled time, or a solution-based event. The application that
  208. receives the trigger to start a function will generally be in charge of
  209. moving the data - it will "push" the data if it is the data producing
  210. application or "pull" the data if it is the data consuming application.
  211.  
  212. You also need to understand the basic data storage and access
  213. mechanisms of the applications to determine where and how the necessary
  214. data can be obtained and stored. The data may be stored in internal
  215. tables, a database, a file, etc. The data may be accessed by using the
  216. application program interface (API) provided by the application, the
  217. application\xd5s import and export mechanisms, data base access calls,
  218. the application\xd5s 4th Generation Language (4GL), etc.
  219.  
  220. This step and the two following ones will result in the data flow
  221. specification for the integrated solution. The best way to represent
  222. this information is to start filling in a specification for each of the
  223. high level data flows. Here is a suggested data flow specification
  224. format:
  225.  
  226. Data Flow: <number> /* from high level data flow design */ Name: <name>
  227. /* from high level data flow design */ Push/Pull: <push/pull> /* from
  228. data control and access design */ Trigger: <trigger type> /* from data
  229. control and access design */ Source: <data source and access mechanism>
  230. /* from data control and access design */ Destination: <data
  231. destination and access mechanism> /* from data control and access
  232. design */ Transfer Mechanism: <message/file & data transfer action
  233. list> /* from adapter d esign */ Source Data Format: <data description>
  234. /* from detailed data definition design * / Destination Data Format:
  235. <data description> /* from detailed data definition design */ Data
  236. Manipulation: <none/HP Sockets (specify source and destination
  237. programming languages) /adapter> /* from detailed data definition
  238. design */
  239.  
  240. 3.3.1   Example
  241.  
  242. For this example, we will examine three of the data flows in detail -
  243. 1B, 3A, an d 8A.
  244.  
  245. Data Flow 1B The SCHD application performs function 1 by creating a
  246. master production plan using the product plan and finished goods
  247. inventory data. Since this function is triggered by an operator at the
  248. console of the SCHD application, the Finished Goods Inventory (FGI)
  249. data is "pulled" from the MRP application to the SCHD application. Here
  250. is a partial specification for data flow 1B:
  251.  
  252. Data Flow: 1B Name: Finished Goods Inventory (FGI) Push/Pull: Pull
  253. Trigger: SCHD Operator Source: MRP database accessed by procedures
  254. written in MRP 4GL Destination: SCHD in memory table accessed by SCHD
  255. batch import mechanism
  256.  
  257. Data Flow 3A The SCHD application also performs function 3 which
  258. releases the new production plan to resource planning. Since this
  259. function is triggered when the production plan is completed, the plan
  260. is "pushed" from the SCHD to the MRP application.  Here is a partial
  261. specification for data flow 3A:
  262.  
  263. Data Flow: 3A Name: Production Plan Push/Pull: Push Trigger: Solution-
  264. based event: completion of production plan Source: SCHD in memory table
  265. accessed by SCHD batch export mechanism Destination: MRP database
  266. accessed by procedures written in MRP 4GL
  267.  
  268. Data Flow 8A The FC application performs function 8 which retrieves new
  269. production recipes from the MRP application if they are needed. Since
  270. this function is triggered whe n the evaluation of a new production
  271. schedule shows that the FC application does not have all of the
  272. necessary recipes, the recipe is "pulled" from the MRP to the FC
  273. application. Here is a partial specification for data flow 8A:
  274.  
  275.  Data Flow: 8A Name: Recipe Push/Pull: Pull Trigger: Solution-based
  276. event: evaluation of the production schedule Source: MRP database
  277. accessed by procedures written in MRP 4GL Destination: FC shared memory
  278. accessed by procedures written in FC 4GL
  279.  
  280.  
  281. 3.4     Design Adapters
  282.  
  283. In this step, you need to design one or more adapters for each
  284. application in the solution based on the high level functions it needs
  285. to perform, the data it needs to produce and/or consume, and the data
  286. access mechanisms it provides. You do not have to design the format of
  287. the messages being passed between the adapters. The HP Sockets Program
  288. has defined a message format to be used to ensure that adapters written
  289. independently will be able to communicate. Refer to the HP Software
  290. Integration Sockets Standard Message Format document for the definition
  291. of that standard format.
  292.  
  293. The adapter design process will most likely be iterative as you gain
  294. more knowledge of the applications and the operation of the final
  295. solution. In the end, the three main design questions that need to be
  296. answered for each application in the solution are:
  297.  
  298. How many and what type of adapters are required? How often will those
  299. adapters run and how will they be started? What are the data transfer
  300. requirements of each of those adapters?
  301.  
  302.  
  303. 3.4.1   Adapter Types
  304.  
  305. An adapter can have one or more of the following types:
  306.  
  307.         "receive" (a server adapter) "send" "send and
  308.         receive" "task sequencing"
  309.  
  310. A "receive" adapter waits for a request to be made of its application
  311. from another HP Sockets adapter, communicates with its application to
  312. fulfill the request, and begins to wait again for the next request.
  313. This waiting can be performed by calling SpReadQ with an infinite
  314. timeout or setting up file and message notification with SpControl and
  315. signal handlers so the adapter receives a signal when a request comes
  316. in. The simpler implementation is using the infinite wait since it
  317. avoids having to write robust signal handlers.
  318.  
  319. If the "receive" adapter gets a request to store incoming data, the
  320. data storage mechanisms of the application are used to store the data.
  321. If the request is to provide data, it can be implemented in a variety
  322. of ways depending on the robustness of the external interface provided
  323. by the application. If the application allows you to add your own
  324. functionality to it (by compiling in functions you have written or
  325. providing scripts or 4GL functions to call), you can pass the data
  326. request to this function and the "receive" adapter can continue its
  327. main job of waiting for incoming requests. In this case, the functions
  328. you have written will extract the requested data from the application
  329. and use a "send" adapter to get the information to the correct
  330. application. A "send" adapter waits for an application trigger before
  331. sending a message or data out to another application using HP Sockets.
  332. This application trigger can be a message sent to the adapter using an
  333. interprocess communication mechanism, a function call if you can link
  334. the send adapter into the application, the actual invocation of the
  335. send adapter, etc.
  336.  
  337. A "send and receive" adapter will have to perform both functions of
  338. receiving or sending a request or data. This type of adapter can be
  339. created using the message notification capability of HP Sockets which
  340. will allow it to receive messages as they arrive even if it is engaged
  341. in another task. The adapter will spend its time processing requests or
  342. data from its application or another application via HP Sockets. It
  343. should have a queue to hold all of these requests that it will process
  344. appropriately. This is basically the "send" aspect of the adapter. The
  345. "receive" aspect of the adapter is implemented by a signal handler that
  346. is in voked by HP Sockets when a message has arrived for the adapter.
  347. That signal handler can either read the messages from its HP Sockets
  348. queue until it is empty or it can read a predetermined number of
  349. messages. It then puts the requests into the adapter queue to process
  350. in turn with the other requests being made of the adapter.
  351.  
  352.  
  353. A "task sequencing" adapter is one that starts and stops other adapters
  354. or processes to make sure that a certain task is performed. An adapter
  355. that sequences tasks may also be a receive and/or send adapter.
  356.  
  357. 3.4.2   Adapter Running
  358.  
  359. For each adapter in the integrated solution, you have to decide how it
  360. should be initially started. Depending on the needs of the solution,
  361. adapters can be started by their applications, by a script run when the
  362. integrated solution is started or by another adapter using the
  363. SpStartProcess access routine.
  364.  
  365. Regardless of how the adapter is initially started, you need to write
  366. the adapter to handle the situation of HP Sockets being stopped while
  367. the adapter is running. Here are a few possible scenarios:
  368.  
  369.  *  Bracket each section of code that uses HP Sockets access routines
  370. with calls to SpInit and SpEnd. If the SpInit fails, the piece of code
  371. is not executed and an error handling section can be executed. Due to
  372. the overhead of calling SpIni t and SpEnd, this is only a good solution
  373. if the adapter does not spend a lot of time calling HP Sockets access
  374. routines.
  375.  * Call SpInit at the start of the adapter and check the results of
  376. each HP Socke ts access routine call to see if an error is returned. If
  377. an error indicating that HP Sockets is down is returned, go to a
  378. section of code that tries to re-establish connection with HP Sockets
  379. every few seconds or end the adapter and have the system administrator
  380. manually re-start it when HP Sockets is re-started.
  381.  
  382. 3.4.3   Data Transfer
  383.  
  384. In the "Define Data Control and Access" step, you investigated the
  385. source and de stination for each data flow and the mechanisms available
  386. to access the data. Now you must take that investigation one step
  387. further and decide whether the data will be transmitted as a message or
  388. a file and whether any additional data transfer mechanisms are required
  389. to get the data from its source to its destination.
  390.  
  391. Sending data in a message allows you to take advantage of the HP
  392. Sockets data manipulation capability, provides more features for the
  393. transfer of the data including sending the message as critical or
  394. guaranteed, and results in faster data transfer than using files. If
  395. the source data is in a file but you want to benefit from sending the
  396. data as a message, simply have the adapter read in the file a record at
  397. a time and send the data as a message. If you are transferring large
  398. amounts of data or data that needs to be stored as a file at both the
  399. source a nd destination side, use the HP Sockets file transfer
  400. facility.
  401.  
  402. Additional data transfer mechanisms will have to be coded in your
  403. adapter if intermediate steps are required to produce or consume the
  404. data. For example if an application provides a batch interface to
  405. respond to requests for data, the adapter for that application may have
  406. to read the incoming message from HP Sockets and invoke the correct
  407. batch function to get the data.
  408.  
  409. At the end of this step you should have a System Overview diagram
  410. showing all of the adapters and applications that will make up your
  411. integrated solution. For each data flow, you should also fill out the
  412. Transfer Mechanism field in the data flow specification.
  413.  
  414. 3.4.4   Example
  415.  
  416. In our example, the SCHD application can only import and export data
  417. via files so we will write two adapters and an auxiliary program to
  418. integrate it into the solution. One adapter is a "receive" adapter,
  419. which is started when the solution is brought up, to wait for incoming
  420. requests. As the requests arrive, it creates a file for SCHD requesting
  421. an action. The auxiliary program polls for files being created by the
  422. "receive" adapter, moves the files to the correct place for SCHD, and
  423. interactively notifies the SCHD operator that data has arrived. The
  424. second adapter, the "send" adapter, is started by the SCHD application
  425. whenever data needs to be sent out from SCHD to another application.
  426.  
  427. The MRP application provides two features that we will take advantage
  428. of when writing our HP Sockets adapters. First, it provides read and
  429. write functions to access its database which can be invoked by sending
  430. a request to its Interface Manager. The communication between the
  431. Interface Manager and the HP Sockets "receive" adapter is via a pipe
  432. set up by the Interface Manager when the MRP application and "receive"
  433. adapters are started. Second, the MRP application allows you to link
  434. code into its program. We will use that feature to link in an HP
  435. Sockets "send" adapter which is started by the Interface Manager for
  436. any data requests made of the MRP application to send the requested
  437. information using HP Sockets .
  438.  
  439. The FC application provides a 4GL for application developers to
  440. customize their application. We will write a few functions in this 4GL
  441. to interact with the FC adapter to get data from and send data to the
  442. application. The functions can directly access the FC application\xd5s
  443. variables and database to allow us a lot of flexibility and capability
  444. within the integrated solution. Since most of the work can be passed
  445. off to the FC functions, we will write one "send and receive" adapter
  446. for this application.
  447.  
  448.  
  449. *** Object: Untitled
  450.  
  451.  
  452. Refer to the System Overview diagram on the previous page for a picture
  453. of the adapter design for the integrated solution. The boxes with the
  454. thick lines show the integration pieces being written for this
  455. solution. In conjunction with designing the adapters, we also need to
  456. determine the transfer mechanism to be used to retrieve and store the
  457. data for each data flow. Here are the transfer mechanisms for the three
  458. data flows we examined in the "Define Data Access and Control" section.
  459. As you will see, this step requires detailed knowledge of the
  460. import/export features of the applications.
  461.  
  462. Data Flow: 1B Name: Finished Goods Inventory (FGI) Push/Pull: Pull
  463. Trigger: SCHD Operator Source: MRP database accessed by procedures
  464. written in MRP\xd5s 4GL Destination: SCHD in memory table accessed by
  465. SCHD\xd5s batch import mechanism Transfer Mechanism: message
  466.  
  467. 1) Operator presses function key which triggers a SCHD procedure to
  468. execute the SCHD "send" adapter to send message to MRP to get FGI.
  469.  
  470. 2) MRP "receive" adapter gets FGI data request message, parses message,
  471. and formats it for the Interface Manager and sends it off.
  472.  
  473. 3) Interface Manager triggers appropriate extract procedure and sends
  474. data to the MRP "send" adapter.
  475.  
  476. 4) MRP "send" adapter sends data to SCHD "receive" adapter.
  477.  
  478. 5) SCHD "receive" adapter writes data to a file until all of the data
  479. is received and then closes the file.
  480.  
  481. 6) SCHD auxiliary program (Notify) recognizes that the input file
  482. exists and in forms the operator who then imports the data using SCHD
  483. functions.
  484.  
  485. Data Flow: 3A Name: Production Plan Push/Pull: Push Trigger: Solution-
  486. based event: completion of production plan Source: SCHD in memory table
  487. accessed by SCHD batch export mechanism Destination: MRP database
  488. accessed by procedures written in MRP 4GL Transfer Mechanism: message
  489.  
  490. 1) Operator presses function key which triggers a SCHD procedure to
  491. store the production plan into a file and execute the SCHD "send"
  492. adapter with the name of the file.
  493.  
  494. 2) SCHD "send" adapter reads the file and sends the data as a series of
  495. messages to the MRP "receive" adapter.
  496.  
  497. 3) MRP "receive" adapter reads the messages, formats the data and sends
  498. it to the Interface Manager via the pipe.
  499.  
  500. 4) The Interface Manager stores the data into the MRP database.
  501.  
  502. Data Flow: 8A Name: Recipe Push/Pull: Pull Trigger: Solution-based
  503. event: evaluation of the production schedule Source: MRP database
  504. accessed by procedures written in MRP 4GL Destination: FC shared memory
  505. accessed by procedures written in FC 4GL Transfer Mechanism: message
  506.  
  507. 1) 4GL function is invoked if FC needs the recipe to produce a part in
  508. its new production schedule.
  509.  
  510. 2) Function causes FC "send" adapter to send a request message to the
  511. MRP "receive" adapter for the recipe.
  512.  
  513. 3) MRP "receive" adapter reads the message, formats the data and sends
  514. it to the Interface Manager via the pipe.
  515.  
  516. 4) The Interface Manager uses a function to get the recipe data and
  517. trigger the MRP "send" adapter to send the recipe to the FC "send and
  518. receive" adapter.
  519.  
  520. 5) FC "send and receive" adapter receives the recipe and uses a 4GL
  521. function to store it in FC shared memory.
  522.  
  523.  
  524. 3.5     Create Detailed Data Definition
  525.  
  526. At this point in creating our integration solution, we know each data
  527. flow that is required, where the data is coming from and going to, and
  528. the steps required to access and transfer that data. We now have to
  529. examine the data at both the producing and consuming ends in more
  530. detail to answer the following questions:
  531.  
  532. What are the data elements at each end of the data flow and what
  533. information do they represent?
  534. What are the data types of each of those elements and what programming
  535. language is used to create or consume that data?
  536. What types of manipulations must be performed on the data to get it
  537. from its source to destination format?
  538. Where and how will those manipulations be performed?
  539.  
  540. Answering the first two questions requires detailed knowledge of the
  541. applications.  There are no tricks involved in this step - simply
  542. investigative work into the applications producing and consuming the
  543. data.  Most of the integrated solutions in existence today pass ASCII
  544. data since it is the only data type compatible between programming
  545. languages and computer architectures. With HP Sockets, you are free to
  546. pass the data in its native format, whether that be ASCII or binary,
  547. since HP Sockets can correct for programming language and computer
  548. architecture differences when passing binary data. You simply have to
  549. know which programming language is used to product and consume the data
  550. so HP Sockets can do the correct transformations.
  551.  
  552. Once the data elements and their types are defined, answering the third
  553. question is straightforward. If the data elements are the same on both
  554. the producing and consuming end in order and data type, you do not need
  555. any data manipulation. If the data elements are different, determine if
  556. HP Sockets supports the conversions necessary. If it does, you can
  557. define the data definitions and manipulations in the configuration
  558. files and HP Sockets will perform the conversions when the data is
  559. sent. If the manipulations are message content based or HP Sockets does
  560. not support th e necessary data structures, either the sending or
  561. receiving adapter must perform the necessary conversions. When the data
  562. being passed is ASCII data of variable length, the adapters must
  563. perform any data conversions required. If you can define a maximum
  564. length for the data, HP Sockets can manipulate it. Generally, the
  565. receiving adapter is designed to do any data manipulations required
  566. since it best knows the data format that its application requires.The
  567. HP Software Integration Sockets Adapter Architecture document describes
  568. a generic way to write the receiving adapter for it to convert the
  569. incoming data into its application format.
  570.  
  571. The information gathered at this step should be added to each of the
  572. data flow specifications. These data flow specifications will be used
  573. to develop the contents of the HP Sockets configuration files and the
  574. adapters in the next step.
  575.  
  576.  
  577. 3.5.1   Example
  578.  
  579. We will do the detailed data design for data flows 1B and 3A.  This
  580. example will fill out the last two fields in the data flow
  581. specification form
  582.  
  583. Data Flow: 1B Name: Finished Goods Inventory (FGI) Source Data Format:
  584. Series of records containing the following two fields:
  585.  
  586. 1) Product - part number of the inventory product - up to 16 ASCII
  587. characters
  588.  
  589. 2) Quantity - quantity of inventory available for this part - variable
  590. length ASCII field Destination Data Format:
  591.  
  592. 1)      Product - part number of the inventory product - variable
  593. length ASCII field
  594. 2)      Quantity - quantity of inventory available for this part -
  595. variable length ASCII field Data Manipulation: none
  596.  
  597. Data Flow: 3A Name: Production Plan Source Data Format: Series of
  598. records
  599. containing the following fields:
  600.  
  601. 1) Date - date when the product quantity will be available - ASCII
  602. field in the format MMDDYYYYHHMMSS.
  603. 2) Product - part number of the inventory product - up to 16 ASCII
  604. characters
  605. 3) Quantity - quantity of inventory that will be available for this
  606. part -variable length ASCII field Destination Data Format:
  607. 1) Date - date when product quantity will be available - Six blank
  608. separated ASCII fields in the format YYYY MM DD HH MM SS.
  609. 2) Product - part number of the inventory product - up to 16 ASCII
  610. characters
  611. 3) Quantity - quantity of inventory that will be available for this
  612. product - variable length ASCII field Data Manipulation: HP Sockets
  613. manipulation of the first field (source and destination programming
  614. languages are C); no manipulation of the other two fields
  615.  
  616.  
  617. 3.6     Create Configuration Files and Adapters
  618.  
  619. Creating the HP Sockets configuration files is really just transferring
  620. the data that you gathered through all of these previous application
  621. integration steps into the appropriate configuration file and format.
  622. Forms exist to help you organize the information gathered to make it
  623. easy to create the configuration files. For a copy of those forms and
  624. the details of the format of the configuration files, refer to the HP
  625. Software Integration Sockets Programmer Manual.
  626.  
  627. You must fill out the Network Definition and Process Definition
  628. configuration files to define the adapters and machines in your
  629. network. To do this, map the adapters you defined in the "Design
  630. Adapters" section onto machines. You should pick logical names for your
  631. adapters that reflect the functionality of the applic ation rather than
  632. the name of the application. By doing this, you can swap the
  633. application and still have configuration files that accurately reflect
  634. the integrated solution.
  635.  
  636. The Data Definition, Data Manipulation Definition, and Link Definition
  637. files only have to be filled out if you decided your data needed to be
  638. manipulated by HP Sockets during the "Create Detailed Data Definition"
  639. step.
  640.  
  641. The File Definition file only has to be filled out if you chose a file
  642. transfer mechanism for any of the data flows during the "Design
  643. Adapters" step.
  644.  
  645. An entire design document, HP Software Integration Sockets Adapter
  646. Architecture, exists to guide you in writing your application adapters.
  647. It covers the layout of an adapter, how to communicate correctly with
  648. HP Sockets, how to detect and report errors in a standard manner, how
  649. to parse and interpret the standard messages that arrive, etc. Use it
  650. together with the information gathered in the previous steps to write
  651. your adapters.
  652.  
  653.  
  654. 3.7     Test and Debug Solution
  655.  
  656. The HP Sockets Manager Command Processor allows you to test your
  657. solution in small steps to fix problems early in the development cycle.
  658.  
  659. First, you should validate your configuration files using the HP
  660. Sockets Manager validate command. Validation detects any syntactic or
  661. semantic errors in your files. Refer to the HP Sockets manuals for help
  662. in this area. Once your configuration files are validated, use two
  663. session of the Command Processor to test your configuration by
  664. simulating each of the adapters. In the first session, initiate
  665. communication with HP Sockets as the first adapter with the init
  666. command and send a message to the second adapter with the enterbuf and
  667. sendmsg commands. In the second session, initiate communication with HP
  668. Sockets as the second adapter with the init command and read the
  669. incoming message with the readq and displaybuf commands.
  670.  
  671. Next your application adapters should be compiled using the appropriate
  672. compiler for the language in which you wrote them. As each adapter is
  673. compiled, you can test its logic with the Command Processor by
  674. initializing as one of the adapters that it will communicate with and
  675. exchanging messages with it.
  676.  
  677. At this stage you have unit tested each of the pieces of the solution
  678. that interact with HP Sockets. What you have left to do is test the
  679. interaction between the adapters and their applications and test the
  680. complete integrated solution.
  681.  
  682. Some common problems encountered during testing are:
  683.  
  684. * Your adapter cannot initiate communication with HP Sockets. Check the
  685. error log file for messages about missing information or incorrect
  686. logical process names. You probably have an inconsistency in your
  687. Network and/or Process Definition files.
  688.  
  689.  * Two adapters on two different machines cannot communicate with one
  690. another. First, verify that the networking between the machines is set
  691. up correctly by using some of the networking services. If the
  692. networking is correct, send messages between the Command Processor on
  693. each of the two machines to determine if HP Sockets is operating
  694. correctly.
  695.  
  696. * The data received by an adapter is incorrect. Check your data, data
  697. manipulation, and link definitions to make sure you have accurately
  698. represented the data that is being passed. You should check items such
  699. as the data types, data lengths, and variable names.
  700.  
  701.  
  702. 3.8     Put Integrated Solution into Production
  703.  
  704. Before putting your integrated solution into production, there are a
  705. number of a dditional questions that need to be addressed. The answers
  706. to these questions a re very dependent on the particular solution and
  707. environment the solution will run in.
  708.  
  709.      How will the HP Sockets Management Daemon, smd, be started when
  710. the machine is booted? A nice solution is to start the smd from a run
  711. file that is invoked when the machine is booted.
  712.  
  713.      How will HP Sockets, the adapters, and the applications be started
  714. up and shut down in order to be synchronized properly? You probably
  715. want to have a script or command file that contains the necessary HP
  716. Sockets Manager commands to both start up and shut down the HP Sockets
  717. domain. You need to decide the appropriate method and order for
  718. starting and stopping the applications and adapters.
  719.  
  720.      How do the configuration files need to be changed to move from the
  721. development environment to the production environment? The names and
  722. addresses of the machines will probably be different in the production
  723. environment. Make the appropriate changes to the Network Definition
  724. file and validate it before starting up HP Sockets in the production
  725. environment.
  726.  
  727.      What should be done with HP Sockets when the machine is being
  728. backed up? If you take down the networking services when a back up is
  729. performed, be sure to gracefully shut down HP Sockets first. If you can
  730. leave the networking services running, HP Sockets can be left running
  731. during the backup.
  732.  
  733.  
  734.      Are the default timeouts adequate for your solution? If you are
  735. running a doma in containing MPE XL nodes or are running over a WAN
  736. with long delays, you may have to increase the event and message
  737. passing timeout values so HP Sockets does not time out. These values
  738. can be changed with the changeparms command in the HP Sockets Manager.
  739.  
  740.  
  741. 4.0     Full Functioned Adapter
  742.  
  743. The previous chapter discussed the steps to create an integrated
  744. solution. Often times though, an adapter is written for an application
  745. independent of a final solution that the adapter may be used in. In
  746. these cases, a full functioned adapter should be written. A full
  747. functioned adapter provides an HP Sockets-based message interface to
  748. all of the functions of its application that can be accessed with any
  749. of its other interfaces. These functions include requests for data ,
  750. requests for an action, and storage of incoming data. By providing this
  751. adapter, or set of adapters, the application can be easily plugged into
  752. a new HP Sockets-based solution without changes to the adapter. To
  753. ensure that these full functioned adapters can really be plugged
  754. together, they must communicate using the standard message format
  755. defined in the HP Software Integration Sockets Standard Message Format
  756. document. By defining the messages that your adapter can accept, you
  757. are providing system integrators with a specification for hooking your
  758. application up to others to provide a new set of features to the user.
  759.  
  760.  
  761. 5.0     Documentation Roadmap
  762.  
  763. The HP Sockets Program can provide you with a series of documents to
  764. help you discover the benefits, features, and technical aspects of
  765. using HP Sockets for your application integration needs. Here is a
  766. roadmap of these resources that are available to you.
  767.  
  768. HP Sockets Product Manuals:
  769.  
  770. HP Software Integration Sockets Self-Paced Tutorial for HP-UX. Tutorial
  771. for the technical implementor of an HP Sockets-based solution on HP-UX.
  772. (Available from HP: 92568-90003)
  773.  
  774. HP Software Integration Sockets Self-Paced Tutorial for MPE XL.
  775. Tutorial for the technical implementor of an HP Sockets-based solution
  776. on MPE XL. (Available from HP: 92616-90004)
  777.  
  778. HP Software Integration Sockets System Administrator Manual.  Manual
  779. for the administrator of an HP Sockets domain.  (Available from HP:
  780. 92568-90002)
  781.  
  782. HP Software Integration Sockets Programmer Manual. Manual for the
  783. technical imp lementor of an HP Sockets-based solution. (Available from
  784. HP: 92568-90001)
  785.  
  786. HP Software Integration Sockets Access Routine Reference. Reference
  787. manual for the technical implementor of an HP Sockets-based solution.
  788. (Available from HP: 92568-90025)
  789.  
  790. Application Notes:
  791.  
  792. Application Integration Using HP Sockets. Application integration steps
  793. for the designer of an HP Sockets-based solution. (Available from CCSY
  794. Hotline; subject: index)
  795.  
  796. HP Software Integration Sockets Standard Message Format. HP Sockets
  797. Program defined message format for the technical implementor of an
  798. application adapter. (Available from CCSY Hotline; subject: index)
  799.  
  800. HP Software Integration Sockets Adapter Architecture. Suggested
  801. architecture an d sample code of an application adapter for the
  802. technical implementor. (Available from CCSY Hotline; subject: index)
  803.  
  804. Connecting Foreign Host Applications to HP Sockets using NCS. A design
  805. for usin g the Network Computing System (NCS) to establish
  806. communication between applications running within an HP Sockets domain
  807. and an application running on a platform which is supported by NCS but
  808. not by HP Sockets. (Available from CCSY Hotline; subject: index)
  809.